package com.zhj.structure.hash.utils;

/**
 * @PackageName:com.zhj.structure.hash.utils
 * @ClassName:HashTable
 * @auter: 朱慧杰
 * @date:2020/8/12 0012 21:01
 **/
public class HashTable {

    private StuInfo[] data = new StuInfo[100];

    public void put(StuInfo stuInfo) {
        // 调用散列函数获取存储位置
        int index = stuInfo.hashCode();
        // 添加元素
        data[index] = stuInfo;
    }

    public StuInfo get(StuInfo stuInfo) {
        return data[stuInfo.hashCode()];
    }

    public StuInfo[] getData() {
        return data;
    }

}
